package hqu.cst.XAH.service.imp;

import hqu.cst.XAH.mapper.CommentMapper;
import hqu.cst.XAH.pojo.Comment;
import hqu.cst.XAH.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImp implements CommentService {

    @Autowired
    private CommentMapper commentMapper;

    @Override
    public Comment submitComment(Comment comment) {
        commentMapper.submitComment(comment);
        return comment;
    }

    @Override
    public List<Comment> getCommentsByMovieId(Long id){
        List<Comment> commentList = commentMapper.getCommentsByMovieId( id);
        return commentList;
    }

}
